/* eslint-disable camelcase,@typescript-eslint/no-unused-vars */ // DO NOT EDIT THIS FILE. AUTO-GENERATED BY mobiletto-orm-typedef-gen import { H3Event } from "h3"; export default defineEventHandler(async (event: H3Event) => { return await filterErrors(event, "account.lookup", async (event: H3Event) => { return await requireAccountObject(event, "account.lookup", async (event: H3Event, session, account) => { const accountRepo = accountRepository(); const id = event?.context?.params?.id; if (!id) throw notFound(accountRepo.typeDef.idFieldName()); const account_by_id = await accountRepo.safeFindById(id); if (account_by_id) return account_by_id; const account_by_username = await accountRepo.safeFindFirstBy("username", id); if (account_by_username) return account_by_username; const account_by_email = await accountRepo.safeFindFirstBy("email", id); if (account_by_email) return account_by_email; throw notFound(id); }); }); });